package com.zhuiYun.project.api.seckill.service;

import com.zhuiYun.project.api.order.entity.SubmitOrderVo;
import com.zhuiYun.project.api.seckill.entity.SeckillDto;
import com.zhuiYun.project.common.errorCode.CommonException;
import com.zhuiYun.project.common.response.CommonResult;

import java.util.List;

/**
 * @ClassName SeckillServiceImpl
 * @Description TODO
 * @Author lx
 * @Date 2023/4/3 15:00
 **/
public interface SeckillService {
    /**
    * @Author lx
    * @Description 首页展示5个限时抢购的商品
    * @Date 2023/4/3 19:29
    * @Return java.util.List<com.zhuiYun.project.api.seckill.entity.SeckillEntity>
    */
    List<SeckillDto> getSeckillAll();

    /**
     * @Author lx
     * @Description 限时抢购商品信息
     * @Date 2023/4/3 19:29
     * @Return java.util.List<com.zhuiYun.project.api.seckill.entity.SeckillEntity>
     */
    List<SeckillDto> getSeckillList();

    /**
    * @Author lx
    * @Description 限时抢购
    * @Date 2023/4/6 9:22
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param userName 用户名
    * @param commId 商品id
    */
    CommonResult doSeckill(String userName, Integer commId) throws Exception;

    /**
    * @Description 使用redis分布式锁 提交diy订单
    * @Author lzy
    * @Date 2023/4/11 16:13
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param submitOrderVo
    */
    CommonResult submitHandworkDiyOrder(SubmitOrderVo submitOrderVo) throws CommonException;

    /**
    * @Description 使用redis预减库存和rabbitMQ异步生成订单
    * @Author lzy
    * @Date 2023/4/19 14:23
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param submitOrderVo
    */
    CommonResult submitCommodityOrder(SubmitOrderVo submitOrderVo) throws CommonException;

    /**
    * @Author lx
    * @Description 根据限时抢购商品点击查询限时抢购商品详细信息
    * @Date 2023/4/11 15:34
    * @Return java.util.List<seckillDto>
    * @param seckillDto
    */
    List<SeckillDto> getSeckillMain(SeckillDto seckillDto);

    /**
    * @Description 关闭秒杀
    * @Author lzy
    * @Date 2023/4/15 14:36
    * @Return void
    * @param commId
    */
    void ShutDownSeckill(String commId);

    /**
    * @Description 将秒杀商品结束的时间存入redis
    * @Author lzy
    * @Date 2023/4/16 18:57
    * @Return void
    */
    void seckillOverTime();
}
